home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 1.iso
/
HENSA
/
MISC
/
SHELL.ARC
/
Shell
/
Sources
/
c
/
DVector
< prev
next >
Wrap
Text File
|
1994-06-25
|
1KB
|
69 lines
#include <stdio.h>
#include "DeskLib:WimpSWIs.h"
#include "Shell.Vector.h"
#include "Shell.Extra.h"
#include "Shell.SafeAlloc.h"
#define COLUMN_WIDTH 8
static void Shell_DoubleVerticalVectorDrawer(
Shell_convertpoint convert,
wimp_point rectsize,
void *reference,
const wimp_rect *redrawrect
)
{
wimp_rect rect = *redrawrect;
double *data = (double *) reference;
int j;
char s[64];
Shell_ConvertToSubTextRect2( &rect, rectsize);
for ( j=rect.min.y; j<=rect.max.y; j++) {
sprintf( s, "%.2g", data[j]);
s[ COLUMN_WIDTH-1] = '\0';
Shell_PrintString( s, 0, rectsize.y - j*Shell_TEXTYSIZE, convert);
}
return;
}
Shell_rectblock *Shell_AddDoubleVerticalVector(
Shell_windblock *w, int x, int y, int size,
int forecol, int backcol, double *data
)
{
Shell_rectblock *rectblock;
rectblock = Shell_AddRectangle2(
w,
x, y - size*Shell_TEXTYSIZE,
x + COLUMN_WIDTH * Shell_TEXTXSIZE, y,
Shell_DoubleVerticalVectorDrawer,
(void *) data
);
Shell_MakeRectIcon( rectblock, forecol, backcol, "r1");
return rectblock;
}